package com.thero.core.command.cmd;

import com.thero.core.command.Command;
import com.thero.core.net.ProtocolMessage;

/**
 * Created by wusk on 2017/11/30.
 * 开始匹配指令
 */
public class MatchCommand extends Command {
    private short home;
    private int playerId;

    public MatchCommand(ProtocolMessage message) throws Exception {
        super(message.getHeader());
        byte[] bytes = message.getMessage();
        if(bytes.length != 6){
            throw new Exception("Invalid message body. wrong message body length.");
        }
        this.home = readShort(bytes[0], bytes[1]);
        this.playerId = readInt(bytes[2], bytes[3], bytes[4], bytes[5]);
    }

    public short getHome(){
        return this.home;
    }

    public int getPlayerId(){
        return this.playerId;
    }
}
